﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace _0812045
{
    public class SpaceShipSprite : BaseSprite
    {
        public enum SpaceShipDirection { Up, Down, Left, Right }

        public override void Update(GameTime theGameTime)
        {
            KeyboardState keyState = Keyboard.GetState();

            if (keyState.IsKeyDown(Keys.Up))
            {
                y += -3.0f;
            }
            if (keyState.IsKeyDown(Keys.Down))
            {
                y += 3.0f;
            }
            if (keyState.IsKeyDown(Keys.Left))
            {
                x += -3.0f;
            }
            if (keyState.IsKeyDown(Keys.Right))
            {
                x += 3.0f;
            }
            base.Update(theGameTime);
        }

        public override void Draw(GameTime gameTime, SpriteBatch theSpriteBatch)
        {
            theSpriteBatch.Draw(_texture2d[_itexture2d], new Vector2(_x,_y),
                new Rectangle(0, 0, _texture2d[_itexture2d].Width, _texture2d[_itexture2d].Height),
                Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0);

            base.Draw(gameTime, theSpriteBatch);
        }
    }
}
